/**
 * @zh 随机正负系数（1或-1）
 * @en Random plus-minus factor (1 or -1)
 */
function randomPM(): 1 | -1 {
    const num = Math.random();
    if (num < 0.5) {
        return 1;
    } else {
        return -1;
    }
}

/**
 * @zh (-1, 1)中随机数
 * @en Random number in (-1, 1)
 */
function randomPM1(): number {
    const num = Math.random();
    return num * randomPM();
}

// 导出模块 Export modules
export { randomPM, randomPM1 };
